home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 February: Technology Seed / Mac Tech Seed Feb '97.toast / ODF Release 3 / ODFDev / Container / Sources / Frame.h < prev    next >
Encoding:
Text File  |  1996-12-16  |  6.1 KB  |  178 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                Frame.h
  4. //    Release Version:    $ ODF 3 $
  5. //
  6. //    Copyright:    (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  7. //
  8. //========================================================================================
  9.  
  10. #ifndef FRAME_H
  11. #define FRAME_H
  12.  
  13. // ----- Part Layer -----
  14.  
  15. #ifndef FWFRMING_H
  16. #include "FWFrming.h"
  17. #endif
  18.  
  19. #ifndef FWCNTPRP_H
  20. #include "FWCntPrp.h"
  21. #endif
  22.  
  23. #ifndef FWDRGDRP_H
  24. #include "FWDrgDrp.h"
  25. #endif
  26.  
  27. //========================================================================================
  28. // Forward Declarations
  29. //========================================================================================
  30.  
  31. class FW_CPresentation;
  32. class FW_CGrowBox;
  33.  
  34. class CContainerPart;
  35. class CContainerSelection;
  36.  
  37. //========================================================================================
  38. //    Defines
  39. //========================================================================================
  40.  
  41. #define kBackgroundColorProp        "Apple:Framework:Property:BackgroundColor"
  42. #define kBackgroundColorValue        "Apple:Framework:Value:BackgroundColor"
  43.  
  44. //========================================================================================
  45. // CContainerFrame
  46. //========================================================================================
  47.  
  48. class CContainerFrame : public FW_CEmbeddingFrame, 
  49.                         public FW_MDraggableFrame, 
  50.                         public FW_MDroppableFrame,
  51.                         public FW_MContainingPropertiesFrame
  52. {
  53. public:
  54.     FW_DECLARE_CLASS
  55.     FW_DECLARE_AUTO(CContainerFrame)
  56.  
  57. //----------------------------------------------------------------------------------------
  58. // Initialization/destruction
  59. //
  60. public:        
  61.     CContainerFrame(Environment* ev, 
  62.                     ODFrame* odFrame, 
  63.                     FW_CPresentation* presentation, 
  64.                     CContainerPart* part);    
  65.     virtual ~ CContainerFrame();
  66.  
  67. //----------------------------------------------------------------------------------------
  68. // Inherited API
  69. //
  70. public:        
  71.     // ----- Menu
  72.     virtual FW_Handled                DoAdjustMenus(Environment* ev, FW_CMenuBar* menuBar, FW_Boolean hasMenuFocus, FW_Boolean isRoot);
  73.     virtual FW_Handled                DoMenu(Environment* ev, const FW_CMenuEvent& theMenuEvent);
  74.     
  75.     // ----- Events -----
  76.     virtual void                    DoActivateEvent(Environment* ev, const FW_CActivateEvent& theActivateEvent);
  77.  
  78.     // ----- Embedded Mouse Events -----
  79.     virtual FW_Handled                DoMouseDownInEmbeddedFrameBorder(Environment* ev, 
  80.                                                         const FW_CBorderMouseEvent& theBorderMouseEvent);
  81.     virtual FW_Handled                DoMouseDownInEmbeddedFrame(Environment* ev, 
  82.                                                         const FW_CEmbeddedMouseEvent& theEmbeddedMouseEvent);
  83.  
  84.     // ----- Frame activation -----                                    
  85.     virtual void                    FocusStateChanged(Environment* ev, 
  86.                                             ODTypeToken focus, 
  87.                                             FW_Boolean newState, 
  88.                                             ODFrame* newOwner);
  89.  
  90.     // ----- Geometry -----                                    
  91.     virtual void                    GeometryChanged(Environment* ev,
  92.                                             ODFacet* odFacet,
  93.                                             FW_Boolean clipShapeChanged,
  94.                                             FW_Boolean externalTransformChanged);
  95.                                             
  96.     // ----- Drag and Drop -----
  97.     virtual ODDragResult            CanAcceptDrop(Environment* ev, ODDragItemIterator* dragInfo);
  98.  
  99.     // ----- Views -----
  100.     virtual void                     PostCreateViewFromStream(Environment* ev);
  101.     
  102.     // ----- Drawing -----
  103.     virtual void                    Draw(Environment* ev, ODFacet* odFacet, ODShape* invalidShape);
  104.  
  105.     // ----- Commands Factory -----
  106.     virtual FW_CClipboardCommand*     NewClipboardCommand(Environment* ev, ODCommandID commandID);
  107.     virtual FW_CInsertCommand*         NewInsertCommand(Environment* ev, const FW_PFileSpecification& fileSpec);
  108.     virtual FW_CDragCommand*         NewDragCommand(Environment* ev, 
  109.                                                 FW_CFrame* theFrame,
  110.                                                 const FW_CMouseEvent& theMouseEvent);
  111.     virtual FW_CDropCommand*        NewDropCommand(Environment* ev, FW_CFrame* frame,
  112.                                                 ODDragItemIterator* dropInfo, 
  113.                                                 ODFacet* facet, const FW_CPoint& windowPoint);
  114.  
  115.     // ----- RequestEmbeddedFrame -----
  116.     virtual FW_MProxy*                EmbeddedFrameRequested(Environment *ev,
  117.                                                         FW_MProxy* baseProxy,
  118.                                                         ODFrame* baseFrame,
  119.                                                         ODShape* frameShape,
  120.                                                         ODPart* embeddedPart,
  121.                                                         ODTypeToken viewType,
  122.                                                         ODTypeToken presentation,
  123.                                                         ODID frameGroupID,
  124.                                                         FW_Boolean isOverlaid,
  125.                                                         FW_Boolean isSubFrame);
  126.     // ----- Internalize/Externalize -----
  127.     virtual void                    ExternalizeFrame(Environment* ev, ODStorageUnitView* storageUnitView);
  128.     virtual void                    InternalizeFrame(Environment* ev, ODStorageUnitView* storageUnitView);
  129.                                                 
  130.     // ----- Window Size ------
  131.     virtual void                    AdjustZoomedWindowSize(Environment* ev, FW_CPoint& proposedSize);
  132.     virtual void                    AdjustWindowGrowLimits(Environment* ev, FW_CPoint& minSize, FW_CPoint& maxSize);
  133.     
  134.     // ----- Containing Part Properties ------
  135.     virtual void                    ExternalizeProperties(Environment* ev, ODStorageUnit* su);
  136.  
  137. //----------------------------------------------------------------------------------------
  138. //    New API
  139. //
  140.   public:
  141.     CContainerSelection*    GetSelection();
  142.     FW_Fixed                GetZoomFactor() const;
  143.     void                    ChangeZoomFactor(Environment* ev, FW_Fixed zoomFactor);
  144.  
  145.     FW_CRect                GetContentRect(Environment* ev) const;
  146.     void                    AdjustContentViewSize(Environment* ev, FW_ERedrawVerb redraw);
  147.  
  148.     void                    ChangeEmbeddedViewType(Environment* ev, ODTypeToken viewAs);
  149.  
  150. //----------------------------------------------------------------------------------------
  151. // Data Members
  152. //
  153. private:    
  154.     CContainerPart*            fContainerPart;
  155.     CContainerSelection*    fSelection;
  156.     
  157.     FW_Fixed                fZoomFactor;
  158. };
  159.  
  160. //----------------------------------------------------------------------------------------
  161. //    CContainerFrame::GetZoomFactor
  162. //----------------------------------------------------------------------------------------
  163. inline FW_Fixed    CContainerFrame::GetZoomFactor() const 
  164. {
  165.     return fZoomFactor;
  166. }
  167.  
  168. //----------------------------------------------------------------------------------------
  169. //    CContainerFrame::GetSelection
  170. //----------------------------------------------------------------------------------------
  171. inline CContainerSelection*    CContainerFrame::GetSelection()
  172. {
  173.     return fSelection;
  174. }
  175.  
  176.  
  177. #endif
  178.